<template>
	<view>
		<home v-if="PageCur=='home'" ref="home"></home>
		<mall v-if="PageCur=='mall'"></mall>
		<mine v-if="PageCur=='mine'"></mine>
			<view class="cu-bar tabbar bg-white shadow foot">
				<view class="action" @click="NavChange" data-cur="home">
					<view class='cuIcon-cu-image'>
						<image :src="'/static/tabbar/home' + [PageCur=='home'?'_cur':''] + '.png'"></image>
					</view>
					<view :class="PageCur=='home'?'tabbar-select-color':'text-color'">首页</view>
				</view>
				<view class="action" @click="NavChange" data-cur="mall">
					<view class='cuIcon-cu-image'>
						<image :src="'/static/tabbar/mall' + [PageCur == 'mall'?'_cur':''] + '.png'"></image>
					</view>
					<view :class="PageCur=='mall'?'tabbar-select-color':'text-color'">商城</view>
				</view>
				<view class="action" @click="NavChange" data-cur="mine">
					<view class='cuIcon-cu-image'>
						<image :src="'/static/tabbar/mine' + [PageCur == 'mine'?'_cur':''] + '.png'"></image>
					</view>
					<view :class="PageCur=='mine'?'tabbar-select-color':'text-color'">我的</view>
				</view>
			</view>				
	</view>
</template>

<script>
	export default {
		data() {
		return {
				PageCur: 'home'
			}
		},
		onPageScroll() {
		  switch (this.PageCur) {
		    case 'home':{
				// this.$refs.home.handleSearchInputShow()
				break
			}
		    default:
		      break
		  }
		},
		methods: {
			NavChange: function(e) {				
				this.PageCur = e.currentTarget.dataset.cur
				if(this.PageCur!=='home'){
					uni.setNavigationBarColor({
					     frontColor: '#000000', // 必写项
					     backgroundColor: '#000000', // 传递的颜色值
					})
				}
				
			}
		}
	}
</script>

<style>
 .tabbar-select-color {
	 color: #1d1d1d;
 }
</style>
